import React  from 'react';
import ReactDOM from 'react-dom';
import {Provider} from 'react-redux';
import store from './store';

import { Router,Route,hashHistory,IndexRoute } from 'react-router';
import App from './modules/App';
import homeContext from './modules/Home';
import newsContext from './modules/news/news';
import newsDetailContext from './modules/news/newsDetail';
import productionContext from './modules/production/production';
import productionDetailContext from './modules/production/productionDetail';
import shopCartContext from './modules/shopCart';
ReactDOM.render(
    <Provider store={store}>
        <Router history={hashHistory}>
            <Route path="/" component={App}>
                <IndexRoute component={homeContext}/>
                <Route path="/news" component={newsContext}/>
                <Route path="/news/:newsId" component={newsDetailContext}/>
                <Route path="/production" component={productionContext}/>
                <Route path="/production/:productionId" component={productionDetailContext}/>
                <Route path="/shopCart" component={shopCartContext}/>
            </Route>
        </Router>
    </Provider>
    ,
    document.getElementById('app')
)